from configobj import ConfigObj


CFG_FILE = "cfg.ini"
config = ConfigObj(CFG_FILE, encoding='UTF8')


def get(name, default=''):
    if config.get(name):
        return config[name]
    else:
        config[name] = default
        config.write()
        return default


def set(name, var):
    config[name] = var
    config.write()
